{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "hr_data = pd.read_csv('https://raw.githubusercontent.com/edyoda/data-science-complete-tutorial/master/Data/HR_comma_sep.csv.txt')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 14999 entries, 0 to 14998\n",
      "Data columns (total 10 columns):\n",
      "satisfaction_level       14999 non-null float64\n",
      "last_evaluation          14999 non-null float64\n",
      "number_project           14999 non-null int64\n",
      "average_montly_hours     14999 non-null int64\n",
      "time_spend_company       14999 non-null int64\n",
      "Work_accident            14999 non-null int64\n",
      "left                     14999 non-null int64\n",
      "promotion_last_5years    14999 non-null int64\n",
      "sales                    14999 non-null object\n",
      "salary                   14999 non-null object\n",
      "dtypes: float64(2), int64(6), object(2)\n",
      "memory usage: 1.1+ MB\n"
     ]
    }
   ],
   "source": [
    "hr_data.info()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "hr_data.rename(columns={'sales':'department'}, inplace=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 14999 entries, 0 to 14998\n",
      "Data columns (total 10 columns):\n",
      "satisfaction_level       14999 non-null float64\n",
      "last_evaluation          14999 non-null float64\n",
      "number_project           14999 non-null int64\n",
      "average_montly_hours     14999 non-null int64\n",
      "time_spend_company       14999 non-null int64\n",
      "Work_accident            14999 non-null int64\n",
      "left                     14999 non-null int64\n",
      "promotion_last_5years    14999 non-null int64\n",
      "department               14999 non-null object\n",
      "salary                   14999 non-null object\n",
      "dtypes: float64(2), int64(6), object(2)\n",
      "memory usage: 1.1+ MB\n"
     ]
    }
   ],
   "source": [
    "hr_data.info()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "feature_data = hr_data.drop(columns=['left'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "target_data = hr_data.left"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "low       7316\n",
       "medium    6446\n",
       "high      1237\n",
       "Name: salary, dtype: int64"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "feature_data.salary.value_counts()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "sales          4140\n",
       "technical      2720\n",
       "support        2229\n",
       "IT             1227\n",
       "product_mng     902\n",
       "marketing       858\n",
       "RandD           787\n",
       "accounting      767\n",
       "hr              739\n",
       "management      630\n",
       "Name: department, dtype: int64"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "feature_data.department.value_counts()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>satisfaction_level</th>\n",
       "      <th>last_evaluation</th>\n",
       "      <th>number_project</th>\n",
       "      <th>average_montly_hours</th>\n",
       "      <th>time_spend_company</th>\n",
       "      <th>Work_accident</th>\n",
       "      <th>promotion_last_5years</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>count</th>\n",
       "      <td>14999.000000</td>\n",
       "      <td>14999.000000</td>\n",
       "      <td>14999.000000</td>\n",
       "      <td>14999.000000</td>\n",
       "      <td>14999.000000</td>\n",
       "      <td>14999.000000</td>\n",
       "      <td>14999.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>mean</th>\n",
       "      <td>0.612834</td>\n",
       "      <td>0.716102</td>\n",
       "      <td>3.803054</td>\n",
       "      <td>201.050337</td>\n",
       "      <td>3.498233</td>\n",
       "      <td>0.144610</td>\n",
       "      <td>0.021268</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>std</th>\n",
       "      <td>0.248631</td>\n",
       "      <td>0.171169</td>\n",
       "      <td>1.232592</td>\n",
       "      <td>49.943099</td>\n",
       "      <td>1.460136</td>\n",
       "      <td>0.351719</td>\n",
       "      <td>0.144281</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>min</th>\n",
       "      <td>0.090000</td>\n",
       "      <td>0.360000</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>96.000000</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25%</th>\n",
       "      <td>0.440000</td>\n",
       "      <td>0.560000</td>\n",
       "      <td>3.000000</td>\n",
       "      <td>156.000000</td>\n",
       "      <td>3.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>50%</th>\n",
       "      <td>0.640000</td>\n",
       "      <td>0.720000</td>\n",
       "      <td>4.000000</td>\n",
       "      <td>200.000000</td>\n",
       "      <td>3.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>75%</th>\n",
       "      <td>0.820000</td>\n",
       "      <td>0.870000</td>\n",
       "      <td>5.000000</td>\n",
       "      <td>245.000000</td>\n",
       "      <td>4.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>max</th>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>7.000000</td>\n",
       "      <td>310.000000</td>\n",
       "      <td>10.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.000000</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "       satisfaction_level  last_evaluation  number_project  \\\n",
       "count        14999.000000     14999.000000    14999.000000   \n",
       "mean             0.612834         0.716102        3.803054   \n",
       "std              0.248631         0.171169        1.232592   \n",
       "min              0.090000         0.360000        2.000000   \n",
       "25%              0.440000         0.560000        3.000000   \n",
       "50%              0.640000         0.720000        4.000000   \n",
       "75%              0.820000         0.870000        5.000000   \n",
       "max              1.000000         1.000000        7.000000   \n",
       "\n",
       "       average_montly_hours  time_spend_company  Work_accident  \\\n",
       "count          14999.000000        14999.000000   14999.000000   \n",
       "mean             201.050337            3.498233       0.144610   \n",
       "std               49.943099            1.460136       0.351719   \n",
       "min               96.000000            2.000000       0.000000   \n",
       "25%              156.000000            3.000000       0.000000   \n",
       "50%              200.000000            3.000000       0.000000   \n",
       "75%              245.000000            4.000000       0.000000   \n",
       "max              310.000000           10.000000       1.000000   \n",
       "\n",
       "       promotion_last_5years  \n",
       "count           14999.000000  \n",
       "mean                0.021268  \n",
       "std                 0.144281  \n",
       "min                 0.000000  \n",
       "25%                 0.000000  \n",
       "50%                 0.000000  \n",
       "75%                 0.000000  \n",
       "max                 1.000000  "
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "feature_data.describe()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [],
   "source": [
    "feature_data_num_cols = feature_data.select_dtypes(exclude=['object']).columns.tolist()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['satisfaction_level',\n",
       " 'last_evaluation',\n",
       " 'number_project',\n",
       " 'average_montly_hours',\n",
       " 'time_spend_company',\n",
       " 'Work_accident',\n",
       " 'promotion_last_5years']"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "feature_data_num_cols"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [],
   "source": [
    "feature_data_cat_cols = feature_data.select_dtypes(include=['object']).columns.tolist()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['department', 'salary']"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "feature_data_cat_cols"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.pipeline import make_pipeline\n",
    "from sklearn.compose import make_column_transformer"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.preprocessing import StandardScaler, OrdinalEncoder"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.impute import SimpleImputer"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "metadata": {},
   "outputs": [],
   "source": [
    "pipeline_num = make_pipeline(StandardScaler())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [],
   "source": [
    "pipeline_cat = make_pipeline(OrdinalEncoder())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [],
   "source": [
    "preprocessor = make_column_transformer((pipeline_num, feature_data_num_cols), \n",
    "                        (pipeline_cat, feature_data_cat_cols))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.linear_model import LogisticRegression\n",
    "from sklearn.tree import DecisionTreeClassifier\n",
    "from sklearn.neighbors import KNeighborsClassifier"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [],
   "source": [
    "lr_pipeline = make_pipeline(preprocessor, LogisticRegression())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {},
   "outputs": [],
   "source": [
    "tree_pipeline = make_pipeline(preprocessor, DecisionTreeClassifier())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.model_selection import train_test_split"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {},
   "outputs": [],
   "source": [
    "trainX, testX, trainY, testY = train_test_split(feature_data, target_data)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Pipeline(memory=None,\n",
       "         steps=[('columntransformer',\n",
       "                 ColumnTransformer(n_jobs=None, remainder='drop',\n",
       "                                   sparse_threshold=0.3,\n",
       "                                   transformer_weights=None,\n",
       "                                   transformers=[('pipeline-1',\n",
       "                                                  Pipeline(memory=None,\n",
       "                                                           steps=[('standardscaler',\n",
       "                                                                   StandardScaler(copy=True,\n",
       "                                                                                  with_mean=True,\n",
       "                                                                                  with_std=True))],\n",
       "                                                           verbose=False),\n",
       "                                                  ['satisfaction_level',\n",
       "                                                   'last_evaluation',\n",
       "                                                   'number_project',\n",
       "                                                   'aver...\n",
       "                                                  ['department', 'salary'])],\n",
       "                                   verbose=False)),\n",
       "                ('decisiontreeclassifier',\n",
       "                 DecisionTreeClassifier(class_weight=None, criterion='gini',\n",
       "                                        max_depth=None, max_features=None,\n",
       "                                        max_leaf_nodes=None,\n",
       "                                        min_impurity_decrease=0.0,\n",
       "                                        min_impurity_split=None,\n",
       "                                        min_samples_leaf=1, min_samples_split=2,\n",
       "                                        min_weight_fraction_leaf=0.0,\n",
       "                                        presort=False, random_state=None,\n",
       "                                        splitter='best'))],\n",
       "         verbose=False)"
      ]
     },
     "execution_count": 39,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "tree_pipeline.fit(trainX, trainY)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.9792"
      ]
     },
     "execution_count": 40,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "tree_pipeline.score(testX,testY)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/awantik/anaconda3/lib/python3.7/site-packages/sklearn/linear_model/logistic.py:432: FutureWarning: Default solver will be changed to 'lbfgs' in 0.22. Specify a solver to silence this warning.\n",
      "  FutureWarning)\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.7784\n",
      "0.9805333333333334\n",
      "0.9472\n"
     ]
    }
   ],
   "source": [
    "for model in [LogisticRegression(), DecisionTreeClassifier(), KNeighborsClassifier()]:\n",
    "    pipeline = make_pipeline(preprocessor, model)\n",
    "    pipeline.fit(trainX, trainY)\n",
    "    print (pipeline.score(testX,testY))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Horror Data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 59,
   "metadata": {},
   "outputs": [],
   "source": [
    "horror_data = pd.read_csv('https://raw.githubusercontent.com/edyoda/data-science-complete-tutorial/master/Data/horror-train.csv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 60,
   "metadata": {},
   "outputs": [],
   "source": [
    "horror_data = horror_data[['text','author']]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 61,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>text</th>\n",
       "      <th>author</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>This process, however, afforded me no means of...</td>\n",
       "      <td>EAP</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>It never once occurred to me that the fumbling...</td>\n",
       "      <td>HPL</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>In his left hand was a gold snuff box, from wh...</td>\n",
       "      <td>EAP</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>How lovely is spring As we looked from Windsor...</td>\n",
       "      <td>MWS</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Finding nothing else, not even gold, the Super...</td>\n",
       "      <td>HPL</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                                text author\n",
       "0  This process, however, afforded me no means of...    EAP\n",
       "1  It never once occurred to me that the fumbling...    HPL\n",
       "2  In his left hand was a gold snuff box, from wh...    EAP\n",
       "3  How lovely is spring As we looked from Windsor...    MWS\n",
       "4  Finding nothing else, not even gold, the Super...    HPL"
      ]
     },
     "execution_count": 61,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "horror_data.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 62,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 19579 entries, 0 to 19578\n",
      "Data columns (total 2 columns):\n",
      "text      19579 non-null object\n",
      "author    19579 non-null object\n",
      "dtypes: object(2)\n",
      "memory usage: 306.0+ KB\n"
     ]
    }
   ],
   "source": [
    "horror_data.info()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 63,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.feature_extraction.text import CountVectorizer"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 64,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.pipeline import make_pipeline"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 65,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.naive_bayes import MultinomialNB"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 66,
   "metadata": {},
   "outputs": [],
   "source": [
    "from nltk.tokenize import RegexpTokenizer"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 67,
   "metadata": {},
   "outputs": [],
   "source": [
    "tokenizer = RegexpTokenizer(r'[A-Za-z]+')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 68,
   "metadata": {},
   "outputs": [],
   "source": [
    "horror_data['text'] = horror_data.text.map(lambda x:tokenizer.tokenize(x))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 69,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>text</th>\n",
       "      <th>author</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>[This, process, however, afforded, me, no, mea...</td>\n",
       "      <td>EAP</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>[It, never, once, occurred, to, me, that, the,...</td>\n",
       "      <td>HPL</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>[In, his, left, hand, was, a, gold, snuff, box...</td>\n",
       "      <td>EAP</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>[How, lovely, is, spring, As, we, looked, from...</td>\n",
       "      <td>MWS</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>[Finding, nothing, else, not, even, gold, the,...</td>\n",
       "      <td>HPL</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                                text author\n",
       "0  [This, process, however, afforded, me, no, mea...    EAP\n",
       "1  [It, never, once, occurred, to, me, that, the,...    HPL\n",
       "2  [In, his, left, hand, was, a, gold, snuff, box...    EAP\n",
       "3  [How, lovely, is, spring, As, we, looked, from...    MWS\n",
       "4  [Finding, nothing, else, not, even, gold, the,...    HPL"
      ]
     },
     "execution_count": 69,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "horror_data.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 70,
   "metadata": {},
   "outputs": [],
   "source": [
    "from nltk.stem.snowball import SnowballStemmer\n",
    "stemmer = SnowballStemmer(\"english\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 71,
   "metadata": {},
   "outputs": [],
   "source": [
    "horror_data['text'] = horror_data.text.map(lambda l: [stemmer.stem(word) for word in l])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 72,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>text</th>\n",
       "      <th>author</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>[this, process, howev, afford, me, no, mean, o...</td>\n",
       "      <td>EAP</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>[it, never, onc, occur, to, me, that, the, fum...</td>\n",
       "      <td>HPL</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>[in, his, left, hand, was, a, gold, snuff, box...</td>\n",
       "      <td>EAP</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>[how, love, is, spring, as, we, look, from, wi...</td>\n",
       "      <td>MWS</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>[find, noth, els, not, even, gold, the, superi...</td>\n",
       "      <td>HPL</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                                text author\n",
       "0  [this, process, howev, afford, me, no, mean, o...    EAP\n",
       "1  [it, never, onc, occur, to, me, that, the, fum...    HPL\n",
       "2  [in, his, left, hand, was, a, gold, snuff, box...    EAP\n",
       "3  [how, love, is, spring, as, we, look, from, wi...    MWS\n",
       "4  [find, noth, els, not, even, gold, the, superi...    HPL"
      ]
     },
     "execution_count": 72,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "horror_data.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 78,
   "metadata": {},
   "outputs": [],
   "source": [
    "horror_data.text = horror_data.text.str.join(sep=' ')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 79,
   "metadata": {},
   "outputs": [],
   "source": [
    "cv = CountVectorizer(stop_words='english')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 80,
   "metadata": {},
   "outputs": [],
   "source": [
    "horror_data_tf = cv.fit_transform(horror_data.text)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 81,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(19579, 14899)"
      ]
     },
     "execution_count": 81,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "horror_data_tf.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 83,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.model_selection import train_test_split\n",
    "trainX, testX, trainY, testY = train_test_split(horror_data_tf, horror_data.author)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 84,
   "metadata": {},
   "outputs": [],
   "source": [
    "mnb = MultinomialNB()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 85,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "MultinomialNB(alpha=1.0, class_prior=None, fit_prior=True)"
      ]
     },
     "execution_count": 85,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mnb.fit(trainX, trainY)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 86,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.8128702757916241"
      ]
     },
     "execution_count": 86,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mnb.score(testX, testY)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 87,
   "metadata": {},
   "outputs": [],
   "source": [
    "test_horror = pd.read_csv('https://raw.githubusercontent.com/edyoda/data-science-complete-tutorial/master/Data/horror-test.csv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 89,
   "metadata": {},
   "outputs": [],
   "source": [
    "test_horror.drop(columns=['id'], inplace=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 90,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>text</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Still, as I urged our leaving Ireland with suc...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>If a fire wanted fanning, it could readily be ...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>And when they had broken down the frail door t...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>While I was thinking how I should possibly man...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>I am not sure to what limit his knowledge may ...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>\"The thick and peculiar mist, or smoke, which ...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>That which is not matter, is not at all unless...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>I sought for repose although I did not hope fo...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>Upon the fourth day of the assassination, a pa...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>\"The tone metaphysical is also a good one.</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>These, the offspring of a later period, stood ...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>What kept him from going with her and Brown Je...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>Persuading the widow that my connexion with he...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>When I arose trembling, I know not how much la...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>And by the shores of the river Zaire there is ...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>Idris heard of her mother's return with pleasure.</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>I say this proudly, but with tears in my eyes ...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>But let us glance at the treatise Ah \"Ability ...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>\"What a place is this that you inhabit, my son...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>At his nod I took one of the latter and seated...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>No one doubted now that the mystery of this mu...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>But although, in one or two instances, arrests...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>Festivity, and even libertinism, became the or...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>For I am Iranon, who was a Prince in Aira.\"</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>\"Gaze not on the star, dear, generous friend,\"...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>I am serious in asserting that my breath was e...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>The thing will haunt me, for who can say the e...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>Before each of the party lay a portion of a sk...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>If she had been bred in that sphere of life to...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>Or, if this mode of speech offend you, let me ...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8362</th>\n",
       "      <td>Then again he distracted my thoughts from my s...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8363</th>\n",
       "      <td>Upon the whole, whether happily or unhappily, ...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8364</th>\n",
       "      <td>He was not allowed to finish this speech in tr...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8365</th>\n",
       "      <td>His looks were wild with terror, and he spoke ...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8366</th>\n",
       "      <td>By the quantity of provision which I had consu...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8367</th>\n",
       "      <td>I hurled after the scoundrel these vehement wo...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8368</th>\n",
       "      <td>Notwithstanding the hazardous object of our jo...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8369</th>\n",
       "      <td>I felt the greatest eagerness to hear the prom...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8370</th>\n",
       "      <td>But in the expression of the countenance, whic...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8371</th>\n",
       "      <td>Its decorations were rich, yet tattered and an...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8372</th>\n",
       "      <td>He directed my attention to some object agains...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8373</th>\n",
       "      <td>Hey? Haow'd ye like to hear the haowlin' night...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8374</th>\n",
       "      <td>She was buried not in a vault, but in an ordin...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8375</th>\n",
       "      <td>In company with this sprightly and clever Gree...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8376</th>\n",
       "      <td>In this unnerved in this pitiable condition I ...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8377</th>\n",
       "      <td>He was a scoundrel, and I don't blame you for ...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8378</th>\n",
       "      <td>But why should I dwell upon the incidents that...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8379</th>\n",
       "      <td>In the streets were spears of long grass, and ...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8380</th>\n",
       "      <td>When I first sought it, it was the love of vir...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8381</th>\n",
       "      <td>But it is in matters beyond the limits of mere...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8382</th>\n",
       "      <td>\"I may say an excellently well constructed house.</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8383</th>\n",
       "      <td>Across a covered bridge one sees a small villa...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8384</th>\n",
       "      <td>You cannot take up a common newspaper in which...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8385</th>\n",
       "      <td>Consoling myself with this reflection, I was m...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8386</th>\n",
       "      <td>Yet we laughed and were merry in our proper wa...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8387</th>\n",
       "      <td>All this is now the fitter for my purpose.</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8388</th>\n",
       "      <td>I fixed myself on a wide solitude.</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8389</th>\n",
       "      <td>It is easily understood that what might improv...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8390</th>\n",
       "      <td>Be this as it may, I now began to feel the ins...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8391</th>\n",
       "      <td>Long winded, statistical, and drearily genealo...</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>8392 rows × 1 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                                                   text\n",
       "0     Still, as I urged our leaving Ireland with suc...\n",
       "1     If a fire wanted fanning, it could readily be ...\n",
       "2     And when they had broken down the frail door t...\n",
       "3     While I was thinking how I should possibly man...\n",
       "4     I am not sure to what limit his knowledge may ...\n",
       "...                                                 ...\n",
       "8387         All this is now the fitter for my purpose.\n",
       "8388                 I fixed myself on a wide solitude.\n",
       "8389  It is easily understood that what might improv...\n",
       "8390  Be this as it may, I now began to feel the ins...\n",
       "8391  Long winded, statistical, and drearily genealo...\n",
       "\n",
       "[8392 rows x 1 columns]"
      ]
     },
     "execution_count": 90,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "cv"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 91,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'process': 10114,\n",
       " 'howev': 6245,\n",
       " 'afford': 218,\n",
       " 'mean': 8010,\n",
       " 'ascertain': 757,\n",
       " 'dimens': 3536,\n",
       " 'dungeon': 3968,\n",
       " 'make': 7824,\n",
       " 'circuit': 2289,\n",
       " 'return': 10834,\n",
       " 'point': 9842,\n",
       " 'whenc': 14550,\n",
       " 'set': 11534,\n",
       " 'awar': 939,\n",
       " 'fact': 4664,\n",
       " 'perfect': 9523,\n",
       " 'uniform': 13753,\n",
       " 'wall': 14404,\n",
       " 'onc': 9004,\n",
       " 'occur': 8924,\n",
       " 'fumbl': 5284,\n",
       " 'mere': 8103,\n",
       " 'mistak': 8266,\n",
       " 'left': 7422,\n",
       " 'hand': 5843,\n",
       " 'gold': 5582,\n",
       " 'snuff': 11924,\n",
       " 'box': 1543,\n",
       " 'caper': 1906,\n",
       " 'hill': 6100,\n",
       " 'cut': 3090,\n",
       " 'manner': 7875,\n",
       " 'fantast': 4719,\n",
       " 'step': 12283,\n",
       " 'took': 13160,\n",
       " 'incess': 6529,\n",
       " 'air': 287,\n",
       " 'greatest': 5678,\n",
       " 'possibl': 9932,\n",
       " 'self': 11457,\n",
       " 'satisfact': 11237,\n",
       " 'love': 7683,\n",
       " 'spring': 12163,\n",
       " 'look': 7651,\n",
       " 'windsor': 14651,\n",
       " 'terrac': 12905,\n",
       " 'sixteen': 11782,\n",
       " 'fertil': 4826,\n",
       " 'counti': 2878,\n",
       " 'spread': 12158,\n",
       " 'beneath': 1231,\n",
       " 'speckl': 12087,\n",
       " 'happi': 5866,\n",
       " 'cottag': 2858,\n",
       " 'wealthier': 14479,\n",
       " 'town': 13208,\n",
       " 'year': 14825,\n",
       " 'heart': 5969,\n",
       " 'cheer': 2171,\n",
       " 'fair': 4680,\n",
       " 'noth': 8808,\n",
       " 'els': 4189,\n",
       " 'superintend': 12574,\n",
       " 'abandon': 4,\n",
       " 'attempt': 845,\n",
       " 'perplex': 9553,\n",
       " 'occasion': 8919,\n",
       " 'steal': 12262,\n",
       " 'counten': 2870,\n",
       " 'sit': 11777,\n",
       " 'think': 12988,\n",
       " 'desk': 3414,\n",
       " 'youth': 14855,\n",
       " 'pass': 9374,\n",
       " 'solitud': 11972,\n",
       " 'best': 1274,\n",
       " 'spent': 12111,\n",
       " 'gentl': 5440,\n",
       " 'feminin': 4810,\n",
       " 'fosterag': 5154,\n",
       " 'refin': 10619,\n",
       " 'groundwork': 5725,\n",
       " 'charact': 2131,\n",
       " 'overcom': 9161,\n",
       " 'intens': 6817,\n",
       " 'distast': 3704,\n",
       " 'usual': 14052,\n",
       " 'brutal': 1686,\n",
       " 'exercis': 4562,\n",
       " 'board': 1440,\n",
       " 'ship': 11620,\n",
       " 'believ': 1213,\n",
       " 'necessari': 8619,\n",
       " 'heard': 5965,\n",
       " 'marin': 7917,\n",
       " 'equal': 4405,\n",
       " 'note': 8807,\n",
       " 'kindli': 7191,\n",
       " 'respect': 10791,\n",
       " 'obedi': 8886,\n",
       " 'paid': 9246,\n",
       " 'crew': 2969,\n",
       " 'felt': 4807,\n",
       " 'peculiar': 9450,\n",
       " 'fortun': 5147,\n",
       " 'abl': 26,\n",
       " 'secur': 11427,\n",
       " 'servic': 11525,\n",
       " 'astronom': 812,\n",
       " 'perhap': 9533,\n",
       " 'refug': 10631,\n",
       " 'suggest': 12511,\n",
       " 'non': 8769,\n",
       " 'luminos': 7717,\n",
       " 'analog': 446,\n",
       " 'sudden': 12502,\n",
       " 'let': 7467,\n",
       " 'fall': 4688,\n",
       " 'surcingl': 12604,\n",
       " 'hung': 6281,\n",
       " 'riband': 10886,\n",
       " 'bodi': 1451,\n",
       " 'knew': 7220,\n",
       " 'say': 11268,\n",
       " 'stereotomi': 12288,\n",
       " 'brought': 1670,\n",
       " 'atomi': 835,\n",
       " 'theori': 12959,\n",
       " 'epicurus': 4387,\n",
       " 'sinc': 11752,\n",
       " 'discuss': 3617,\n",
       " 'subject': 12460,\n",
       " 'veri': 14188,\n",
       " 'long': 7642,\n",
       " 'ago': 255,\n",
       " 'mention': 8090,\n",
       " 'singular': 11763,\n",
       " 'littl': 7578,\n",
       " 'notic': 8810,\n",
       " 'vagu': 14077,\n",
       " 'guess': 5749,\n",
       " 'nobl': 8747,\n",
       " 'greek': 5685,\n",
       " 'met': 8129,\n",
       " 'confirm': 2643,\n",
       " 'late': 7342,\n",
       " 'nebular': 8616,\n",
       " 'cosmogoni': 2851,\n",
       " 'avoid': 932,\n",
       " 'cast': 1985,\n",
       " 'eye': 4644,\n",
       " 'upward': 14036,\n",
       " 'great': 5676,\n",
       " 'nebula': 8615,\n",
       " 'orion': 9065,\n",
       " 'certain': 2076,\n",
       " 'expect': 4585,\n",
       " 'confess': 2638,\n",
       " 'structur': 12416,\n",
       " 'languag': 7310,\n",
       " 'code': 2438,\n",
       " 'govern': 5614,\n",
       " 'polit': 9855,\n",
       " 'various': 14125,\n",
       " 'state': 12244,\n",
       " 'possess': 9929,\n",
       " 'attract': 856,\n",
       " 'shall': 11565,\n",
       " 'feel': 4789,\n",
       " 'injuri': 6722,\n",
       " 'learn': 7401,\n",
       " 'dread': 3861,\n",
       " 'reveng': 10841,\n",
       " 'day': 3190,\n",
       " 'arriv': 728,\n",
       " 'barricad': 1074,\n",
       " 'ourselv': 9106,\n",
       " 'present': 10038,\n",
       " 'herbert': 6046,\n",
       " 'west': 14525,\n",
       " 'need': 8626,\n",
       " 'fresh': 5216,\n",
       " 'becaus': 1148,\n",
       " 'life': 7506,\n",
       " 'work': 14728,\n",
       " 'reanim': 10525,\n",
       " 'dead': 3197,\n",
       " 'farm': 4725,\n",
       " 'like': 7523,\n",
       " 'ground': 5724,\n",
       " 'extend': 4621,\n",
       " 'deepli': 3272,\n",
       " 'wheaton': 14545,\n",
       " 'street': 12381,\n",
       " 'glanc': 5517,\n",
       " 'fallaci': 4689,\n",
       " 'idea': 6353,\n",
       " 'escap': 4438,\n",
       " 'commenc': 2516,\n",
       " 'destruct': 3436,\n",
       " 'endless': 4280,\n",
       " 'journey': 7076,\n",
       " 'mountain': 8438,\n",
       " 'ice': 6346,\n",
       " 'ocean': 8926,\n",
       " 'amidst': 422,\n",
       " 'cold': 2456,\n",
       " 'inhabit': 6706,\n",
       " 'endur': 4284,\n",
       " 'nativ': 8585,\n",
       " 'genial': 5434,\n",
       " 'sunni': 12551,\n",
       " 'climat': 2374,\n",
       " 'hope': 6195,\n",
       " 'surviv': 12627,\n",
       " 'speech': 12099,\n",
       " 'gave': 5413,\n",
       " 'cours': 2889,\n",
       " 'interpret': 6842,\n",
       " 'fanci': 4710,\n",
       " 'doubt': 3812,\n",
       " 'event': 4504,\n",
       " 'come': 2500,\n",
       " 'vast': 14131,\n",
       " 'quantiti': 10344,\n",
       " 'readi': 10509,\n",
       " 'money': 8327,\n",
       " 'provid': 10214,\n",
       " 'owe': 9214,\n",
       " 'trifl': 13329,\n",
       " 'consider': 2692,\n",
       " 'dare': 3162,\n",
       " 'care': 1937,\n",
       " 'becam': 1147,\n",
       " 'soul': 12027,\n",
       " 'carcass': 1933,\n",
       " 'sprightli': 12161,\n",
       " 'undu': 13665,\n",
       " 'excit': 4545,\n",
       " 'placid': 9757,\n",
       " 'repos': 10748,\n",
       " 'content': 2739,\n",
       " 'children': 2209,\n",
       " 'beauti': 1142,\n",
       " 'surround': 12624,\n",
       " 'natur': 8586,\n",
       " 'went': 14517,\n",
       " 'far': 4721,\n",
       " 'speak': 12075,\n",
       " 'slight': 11847,\n",
       " 'hectic': 5993,\n",
       " 'cough': 2863,\n",
       " 'time': 13092,\n",
       " 'troubl': 13364,\n",
       " 'chronic': 2266,\n",
       " 'rheumat': 10869,\n",
       " 'twing': 13460,\n",
       " 'hereditari': 6054,\n",
       " 'gout': 5611,\n",
       " 'conclus': 2614,\n",
       " 'disagre': 3570,\n",
       " 'inconveni': 6569,\n",
       " 'hitherto': 6129,\n",
       " 'conceal': 2597,\n",
       " 'weak': 14473,\n",
       " 'facial': 4659,\n",
       " 'aspect': 775,\n",
       " 'remark': 10693,\n",
       " 'matur': 7986,\n",
       " 'share': 11580,\n",
       " 'mother': 8422,\n",
       " 'grandfath': 5633,\n",
       " 'chinless': 2225,\n",
       " 'firm': 4915,\n",
       " 'precoci': 9991,\n",
       " 'shape': 11578,\n",
       " 'nose': 8802,\n",
       " 'unit': 13773,\n",
       " 'express': 4615,\n",
       " 'larg': 7328,\n",
       " 'dark': 3164,\n",
       " 'latin': 7349,\n",
       " 'quasi': 10353,\n",
       " 'adulthood': 175,\n",
       " 'nigh': 8714,\n",
       " 'preternatur': 10054,\n",
       " 'intellig': 6814,\n",
       " 'net': 8660,\n",
       " 'perman': 9544,\n",
       " 'fasten': 4739,\n",
       " 'hoop': 6191,\n",
       " 'attach': 842,\n",
       " 'seri': 11518,\n",
       " 'run': 11085,\n",
       " 'loop': 7656,\n",
       " 'noos': 8780,\n",
       " 'sound': 12029,\n",
       " 'hideous': 6090,\n",
       " 'held': 6015,\n",
       " 'vibrat': 14227,\n",
       " 'globe': 5538,\n",
       " 'earth': 4021,\n",
       " 'interv': 6853,\n",
       " 'assum': 799,\n",
       " 'symphon': 12708,\n",
       " 'qualiti': 10342,\n",
       " 'hard': 5875,\n",
       " 'conceiv': 2600,\n",
       " 'produc': 10124,\n",
       " 'player': 9786,\n",
       " 'everi': 4509,\n",
       " 'wilder': 14624,\n",
       " 'balconi': 1004,\n",
       " 'veranda': 14175,\n",
       " 'minaret': 8201,\n",
       " 'shrine': 11665,\n",
       " 'carv': 1969,\n",
       " 'oriel': 9060,\n",
       " 'deep': 3268,\n",
       " 'spirit': 12129,\n",
       " 'wonder': 14709,\n",
       " 'wont': 14712,\n",
       " 'regard': 10637,\n",
       " 'remot': 10711,\n",
       " 'pew': 9613,\n",
       " 'galleri': 5352,\n",
       " 'solemn': 11965,\n",
       " 'slow': 11870,\n",
       " 'ascend': 754,\n",
       " 'pulpit': 10266,\n",
       " 'reverend': 10846,\n",
       " 'man': 7856,\n",
       " 'demur': 3353,\n",
       " 'benign': 1239,\n",
       " 'robe': 10968,\n",
       " 'glossi': 5546,\n",
       " 'cleric': 2364,\n",
       " 'flow': 5009,\n",
       " 'wig': 14617,\n",
       " 'minut': 8219,\n",
       " 'powder': 9958,\n",
       " 'rigid': 10917,\n",
       " 'sour': 12033,\n",
       " 'visag': 14291,\n",
       " 'snuffi': 11925,\n",
       " 'habili': 5799,\n",
       " 'administ': 153,\n",
       " 'ferul': 4827,\n",
       " 'draconian': 3834,\n",
       " 'law': 7372,\n",
       " 'academi': 62,\n",
       " 'bizarr': 1362,\n",
       " 'explan': 4601,\n",
       " 'follow': 5052,\n",
       " 'mani': 7866,\n",
       " 'prodigi': 10123,\n",
       " 'sign': 11711,\n",
       " 'taken': 12741,\n",
       " 'place': 9755,\n",
       " 'wide': 14606,\n",
       " 'sea': 11391,\n",
       " 'land': 7295,\n",
       " 'black': 1365,\n",
       " 'wing': 14655,\n",
       " 'pestil': 9592,\n",
       " 'abroad': 40,\n",
       " 'said': 11143,\n",
       " 'known': 7237,\n",
       " 'pure': 10291,\n",
       " 'readili': 10511,\n",
       " 'lead': 7388,\n",
       " 'connect': 2672,\n",
       " 'substanc': 12478,\n",
       " 'kind': 7187,\n",
       " 'proport': 10178,\n",
       " 'unknown': 13783,\n",
       " 'specul': 12096,\n",
       " 'busi': 1764,\n",
       " 'immedi': 6414,\n",
       " 'ultim': 13493,\n",
       " 'result': 10807,\n",
       " 'discoveri': 3611,\n",
       " 'person': 9566,\n",
       " 'hesit': 6074,\n",
       " 'refer': 10617,\n",
       " 'increas': 6572,\n",
       " 'matter': 7983,\n",
       " 'general': 5428,\n",
       " 'develop': 3452,\n",
       " 'california': 1834,\n",
       " 'reflect': 10622,\n",
       " 'bring': 1633,\n",
       " 'inevit': 6645,\n",
       " 'anoth': 519,\n",
       " 'exceed': 4539,\n",
       " 'inopportun': 6744,\n",
       " 'von': 14341,\n",
       " 'kempelen': 7158,\n",
       " 'analysi': 448,\n",
       " 'verg': 14186,\n",
       " 'comprehens': 2584,\n",
       " 'power': 9959,\n",
       " 'comprehend': 2583,\n",
       " 'men': 8075,\n",
       " 'themselv': 12950,\n",
       " 'brink': 1636,\n",
       " 'remembr': 10698,\n",
       " 'end': 4275,\n",
       " 'rememb': 10696,\n",
       " 'compass': 2554,\n",
       " 'depth': 3385,\n",
       " 'gaug': 5408,\n",
       " 'delic': 3310,\n",
       " 'instrument': 6798,\n",
       " 'ruin': 11070,\n",
       " 'henceforth': 6038,\n",
       " 'onli': 9011,\n",
       " 'reckon': 10556,\n",
       " 'guesswork': 5751,\n",
       " 'base': 1085,\n",
       " 'watch': 14447,\n",
       " 'calendar': 1832,\n",
       " 'appar': 595,\n",
       " 'drift': 3879,\n",
       " 'judg': 7088,\n",
       " 'ani': 498,\n",
       " 'object': 8890,\n",
       " 'spi': 12117,\n",
       " 'porthol': 9916,\n",
       " 'tower': 13207,\n",
       " 'young': 14847,\n",
       " 'warrior': 14439,\n",
       " 'sarnath': 11219,\n",
       " 'symbol': 12700,\n",
       " 'conquest': 2680,\n",
       " 'old': 8975,\n",
       " 'god': 5567,\n",
       " 'ib': 6339,\n",
       " 'leadership': 7391,\n",
       " 'mnar': 8283,\n",
       " 'meantim': 8017,\n",
       " 'paradis': 9309,\n",
       " 'arnheim': 715,\n",
       " 'burst': 1758,\n",
       " 'view': 14247,\n",
       " 'rich': 10891,\n",
       " 'guardian': 5745,\n",
       " 'appoint': 617,\n",
       " 'act': 119,\n",
       " 'societi': 11937,\n",
       " 'secret': 11420,\n",
       " 'realli': 10522,\n",
       " 'dim': 3535,\n",
       " 'light': 7514,\n",
       " 'contain': 2732,\n",
       " 'propheci': 10173,\n",
       " 'relat': 10667,\n",
       " 'modern': 8296,\n",
       " 'date': 3182,\n",
       " 'exclam': 4547,\n",
       " 'exult': 4643,\n",
       " 'woe': 14693,\n",
       " 'victori': 14238,\n",
       " 'defeat': 3278,\n",
       " 'trace': 13214,\n",
       " 'scant': 11283,\n",
       " 'page': 9243,\n",
       " 'talk': 12747,\n",
       " 'tomb': 13148,\n",
       " 'sheehan': 11595,\n",
       " 'especi': 4448,\n",
       " 'did': 3501,\n",
       " 'pli': 9804,\n",
       " 'inquiri': 6751,\n",
       " 'elicit': 4159,\n",
       " 'inform': 6689,\n",
       " 'valu': 14099,\n",
       " 'concern': 2603,\n",
       " 'bug': 1706,\n",
       " 'cri': 2970,\n",
       " 'aloud': 378,\n",
       " 'later': 7344,\n",
       " 'gasp': 5401,\n",
       " 'terribl': 12910,\n",
       " 'track': 13217,\n",
       " 'cross': 2992,\n",
       " 'river': 10952,\n",
       " 'grade': 5623,\n",
       " 'veer': 14141,\n",
       " 'region': 10643,\n",
       " 'rural': 11092,\n",
       " 'innsmouth': 6740,\n",
       " 'abhorr': 19,\n",
       " 'fishi': 4926,\n",
       " 'odour': 8946,\n",
       " 'overflow': 9166,\n",
       " 'ardent': 677,\n",
       " 'affect': 208,\n",
       " 'friendship': 5229,\n",
       " 'devot': 3463,\n",
       " 'wondrous': 14711,\n",
       " 'world': 14734,\n",
       " 'mind': 8203,\n",
       " 'teach': 12813,\n",
       " 'imagin': 6404,\n",
       " 'start': 12239,\n",
       " 'replac': 10741,\n",
       " 'tissu': 13120,\n",
       " 'wrap': 14757,\n",
       " 'portrait': 9921,\n",
       " 'shield': 11613,\n",
       " 'sordid': 12013,\n",
       " 'condit': 2626,\n",
       " 'affair': 207,\n",
       " 'court': 2891,\n",
       " 'intrigu': 6872,\n",
       " 'involv': 6909,\n",
       " 'render': 10720,\n",
       " 'instant': 6786,\n",
       " 'avail': 912,\n",
       " 'document': 3748,\n",
       " 'suscept': 12629,\n",
       " 'moment': 8318,\n",
       " 'near': 8605,\n",
       " 'import': 6468,\n",
       " 'wilbur': 14621,\n",
       " 'growth': 5732,\n",
       " 'inde': 6582,\n",
       " 'phenomen': 9628,\n",
       " 'month': 8355,\n",
       " 'birth': 1345,\n",
       " 'attain': 844,\n",
       " 'size': 11786,\n",
       " 'muscular': 8501,\n",
       " 'infant': 6661,\n",
       " 'age': 241,\n",
       " 'paus': 9422,\n",
       " 'succeed': 12494,\n",
       " 'difficulti': 3516,\n",
       " 'rais': 10436,\n",
       " 'reveal': 10838,\n",
       " 'apertur': 575,\n",
       " 'exhal': 4566,\n",
       " 'noxious': 8835,\n",
       " 'fume': 5285,\n",
       " 'caus': 2019,\n",
       " 'torch': 13173,\n",
       " 'sputter': 12175,\n",
       " 'disclos': 3592,\n",
       " 'unsteadi': 13938,\n",
       " 'glare': 5520,\n",
       " 'flight': 4984,\n",
       " 'stone': 12327,\n",
       " 'mud': 8464,\n",
       " 'water': 14453,\n",
       " 'sky': 11806,\n",
       " 'rain': 10432,\n",
       " 'wipin': 14661,\n",
       " 'aout': 568,\n",
       " 'abaout': 5,\n",
       " 'fast': 4738,\n",
       " 'beginnin': 1186,\n",
       " 'glen': 5529,\n",
       " 'maouth': 7899,\n",
       " 'whar': 14538,\n",
       " 'tree': 13291,\n",
       " 'aw': 935,\n",
       " 'print': 10091,\n",
       " 'big': 1319,\n",
       " 'bar': 1041,\n",
       " 'ls': 7696,\n",
       " 'seen': 11443,\n",
       " 'monday': 8326,\n",
       " 'visit': 14300,\n",
       " 'merriv': 8113,\n",
       " 'befor': 1177,\n",
       " 'frequent': 5214,\n",
       " 'ceas': 2038,\n",
       " 'suppos': 12595,\n",
       " 'underduk': 13624,\n",
       " 'suffer': 12504,\n",
       " 'impertin': 6453,\n",
       " 'impun': 6498,\n",
       " 'tell': 12842,\n",
       " 'sceptic': 11302,\n",
       " 'topic': 13165,\n",
       " 'immort': 6424,\n",
       " 'compar': 2551,\n",
       " 'chief': 2200,\n",
       " 'superior': 12575,\n",
       " 'consist': 2694,\n",
       " 'soon': 12002,\n",
       " 'persuad': 9572,\n",
       " 'inferior': 6668,\n",
       " 'chiefest': 2201,\n",
       " 'potent': 9946,\n",
       " 'newcom': 8681,\n",
       " 'grew': 5698,\n",
       " 'dr': 3832,\n",
       " 'johnson': 7056,\n",
       " 'beheld': 1196,\n",
       " 'pursi': 10309,\n",
       " 'ill': 6388,\n",
       " 'drest': 3876,\n",
       " 'sloven': 11869,\n",
       " 'murmur': 8497,\n",
       " 'fell': 4800,\n",
       " 'ear': 4012,\n",
       " 'afterward': 236,\n",
       " 'turn': 13432,\n",
       " 'road': 10956,\n",
       " 'somewhat': 11988,\n",
       " 'abrupt': 41,\n",
       " 'build': 1710,\n",
       " 'lay': 7380,\n",
       " 'foot': 5064,\n",
       " 'decliv': 3247,\n",
       " 'just': 7117,\n",
       " 'ellison': 4181,\n",
       " 'continu': 2748,\n",
       " 'profus': 10143,\n",
       " 'good': 5591,\n",
       " 'gift': 5487,\n",
       " 'lavish': 7370,\n",
       " 'plane': 9768,\n",
       " 'elips': 4164,\n",
       " 'progress': 10147,\n",
       " 'eastward': 4034,\n",
       " 'useless': 14048,\n",
       " 'thing': 12985,\n",
       " 'abund': 56,\n",
       " 'provis': 10218,\n",
       " 'fli': 4982,\n",
       " 'quick': 10373,\n",
       " 'snow': 11918,\n",
       " 'sledg': 11833,\n",
       " 'motion': 8423,\n",
       " 'pleasant': 9796,\n",
       " 'opinion': 9029,\n",
       " 'agreeabl': 263,\n",
       " 'english': 4298,\n",
       " 'stagecoach': 12206,\n",
       " 'spot': 12152,\n",
       " 'disappear': 3571,\n",
       " 'boat': 1443,\n",
       " 'vain': 14081,\n",
       " 'indistinct': 6615,\n",
       " 'recollect': 10565,\n",
       " 'storm': 12341,\n",
       " 'reach': 10504,\n",
       " 'rate': 10480,\n",
       " 'know': 7233,\n",
       " 'peal': 9441,\n",
       " 'thunder': 13049,\n",
       " 'tone': 13155,\n",
       " 'utter': 14062,\n",
       " 'wildest': 14625,\n",
       " 'mood': 8358,\n",
       " 'courtyard': 2895,\n",
       " 'chanc': 2113,\n",
       " 'away': 941,\n",
       " 'alarm': 301,\n",
       " 'mein': 8054,\n",
       " 'gott': 5608,\n",
       " 'vor': 14348,\n",
       " 'shicken': 11612,\n",
       " 'oh': 8965,\n",
       " 'repli': 10745,\n",
       " 'chicken': 2198,\n",
       " 'perpetu': 9551,\n",
       " 'fear': 4769,\n",
       " 'jaundic': 7008,\n",
       " 'complexion': 2574,\n",
       " 'shrivel': 11668,\n",
       " 'sun': 12536,\n",
       " 'atmospher': 833,\n",
       " 'star': 12232,\n",
       " 'longer': 7644,\n",
       " 'shone': 11634,\n",
       " 'companionless': 2548,\n",
       " 'cloud': 2399,\n",
       " 'sunk': 12547,\n",
       " 'horizon': 6202,\n",
       " 'descend': 3399,\n",
       " 'swift': 12666,\n",
       " 'western': 14527,\n",
       " 'nois': 8758,\n",
       " 'came': 1849,\n",
       " 'new': 8677,\n",
       " 'horror': 6212,\n",
       " 'gone': 5589,\n",
       " 'room': 11003,\n",
       " 'suffici': 12506,\n",
       " 'roomi': 11004,\n",
       " 'berth': 1259,\n",
       " 'abov': 37,\n",
       " 'ancient': 465,\n",
       " 'roof': 11001,\n",
       " 'chimney': 2218,\n",
       " 'pot': 9943,\n",
       " 'outsid': 9141,\n",
       " 'queer': 10358,\n",
       " 'bull': 1721,\n",
       " 'window': 14648,\n",
       " 'pane': 9286,\n",
       " 'march': 7906,\n",
       " 'southern': 12041,\n",
       " 'quarter': 10350,\n",
       " 'desert': 3407,\n",
       " 'villag': 14261,\n",
       " 'sent': 11488,\n",
       " 'island': 6961,\n",
       " 'season': 11405,\n",
       " 'winter': 14658,\n",
       " 'reviv': 10855,\n",
       " 'energi': 4288,\n",
       " 'countri': 2880,\n",
       " 'defend': 3282,\n",
       " 'number': 8851,\n",
       " 'prohibit': 10148,\n",
       " 'damp': 3144,\n",
       " 'unpleas': 13856,\n",
       " 'ampl': 432,\n",
       " 'space': 12050,\n",
       " 'car': 1926,\n",
       " 'enabl': 4248,\n",
       " 'lie': 7501,\n",
       " 'cloak': 2384,\n",
       " 'blanket': 1384,\n",
       " 'conquer': 2678,\n",
       " 'till': 13082,\n",
       " 'sold': 11960,\n",
       " 'death': 3210,\n",
       " 'sole': 11963,\n",
       " 'thou': 13009,\n",
       " 'shouldst': 11651,\n",
       " 'war': 14423,\n",
       " 'plagu': 9758,\n",
       " 'thi': 12976,\n",
       " 'raymond': 10499,\n",
       " 'safeti': 11135,\n",
       " 'thee': 12947,\n",
       " 'heavi': 5985,\n",
       " 'listen': 7561,\n",
       " 'chang': 2115,\n",
       " 'delirium': 3316,\n",
       " 'bed': 1151,\n",
       " 'violenc': 14276,\n",
       " 'decreas': 3256,\n",
       " 'clammi': 2318,\n",
       " 'dew': 3468,\n",
       " 'stood': 12330,\n",
       " 'brow': 1671,\n",
       " 'pale': 9265,\n",
       " 'crimson': 2974,\n",
       " 'fever': 4843,\n",
       " 'interior': 6829,\n",
       " 'hous': 6236,\n",
       " 'constant': 2705,\n",
       " 'face': 4657,\n",
       " 'furnitur': 5308,\n",
       " 'door': 3791,\n",
       " 'flux': 5026,\n",
       " 'presum': 10047,\n",
       " 'mobil': 8288,\n",
       " 'gentleman': 5441,\n",
       " 'cloth': 2398,\n",
       " 'head': 5946,\n",
       " 'embroid': 4218,\n",
       " 'silk': 11725,\n",
       " 'velvet': 14154,\n",
       " 'pall': 9267,\n",
       " 'neglig': 8632,\n",
       " 'form': 5123,\n",
       " 'fashion': 4737,\n",
       " 'spanish': 12059,\n",
       " 'pigeon': 9690,\n",
       " 'appear': 600,\n",
       " 'distress': 3715,\n",
       " 'extrem': 4637,\n",
       " 'struggl': 12417,\n",
       " 'cat': 1992,\n",
       " 'mew': 8147,\n",
       " 'piteous': 9741,\n",
       " 'tongu': 13157,\n",
       " 'hang': 5854,\n",
       " 'mouth': 8447,\n",
       " 'stagger': 12207,\n",
       " 'fro': 5239,\n",
       " 'influenc': 6685,\n",
       " 'poison': 9845,\n",
       " 'pant': 9294,\n",
       " 'breath': 1591,\n",
       " 'design': 3411,\n",
       " 'tormentor': 13178,\n",
       " 'unrel': 13885,\n",
       " 'demoniac': 3349,\n",
       " 'shrank': 11658,\n",
       " 'glow': 5549,\n",
       " 'metal': 8131,\n",
       " 'centr': 2062,\n",
       " 'cell': 2047,\n",
       " 'gain': 5339,\n",
       " 'feet': 4793,\n",
       " 'dizzili': 3739,\n",
       " 'struck': 12415,\n",
       " 'breaker': 1585,\n",
       " 'terrif': 12911,\n",
       " 'whirlpool': 14580,\n",
       " 'foam': 5029,\n",
       " 'engulf': 4306,\n",
       " 'morn': 8390,\n",
       " 'deliv': 3317,\n",
       " 'letter': 7471,\n",
       " 'introduct': 6875,\n",
       " 'princip': 10087,\n",
       " 'professor': 10130,\n",
       " 'draw': 3856,\n",
       " 'vivid': 14314,\n",
       " 'colour': 2487,\n",
       " 'splendour': 12138,\n",
       " 'kingdom': 7195,\n",
       " 'opposit': 9037,\n",
       " 'commerci': 2522,\n",
       " 'republican': 10761,\n",
       " 'celebr': 2043,\n",
       " 'magazin': 7786,\n",
       " 'sustain': 12635,\n",
       " 'evid': 4520,\n",
       " 'tremend': 13300,\n",
       " 'expens': 4592,\n",
       " 'understand': 13637,\n",
       " 'week': 14500,\n",
       " 'visibl': 14296,\n",
       " 'fade': 4671,\n",
       " 'discern': 3587,\n",
       " 'nake': 8552,\n",
       " 'stranger': 12366,\n",
       " 'twenti': 13452,\n",
       " 'word': 14723,\n",
       " 'lesson': 7465,\n",
       " 'understood': 13638,\n",
       " 'profit': 10136,\n",
       " 'peopl': 9500,\n",
       " 'degre': 3298,\n",
       " 'decis': 3240,\n",
       " 'case': 1974,\n",
       " 'sieg': 11702,\n",
       " 'constantinopl': 2707,\n",
       " 'caviti': 2033,\n",
       " 'detect': 3440,\n",
       " 'lieuten': 7505,\n",
       " 'instanc': 6785,\n",
       " 'courag': 2887,\n",
       " 'enterpris': 4346,\n",
       " 'mad': 7771,\n",
       " 'desir': 3412,\n",
       " 'glori': 5542,\n",
       " 'phrase': 9653,\n",
       " 'characterist': 2135,\n",
       " 'advanc': 176,\n",
       " 'profess': 10128,\n",
       " 'hour': 6234,\n",
       " 'machin': 7767,\n",
       " 'tabl': 12726,\n",
       " 'generat': 5429,\n",
       " 'wave': 14462,\n",
       " 'unrecognis': 13882,\n",
       " 'sens': 11480,\n",
       " 'organ': 9055,\n",
       " 'exist': 4576,\n",
       " 'atrophi': 841,\n",
       " 'rudimentari': 11063,\n",
       " 'vestig': 14213,\n",
       " 'everybodi': 4513,\n",
       " 'got': 5606,\n",
       " 'ide': 6352,\n",
       " 'dyin': 4005,\n",
       " 'excep': 4542,\n",
       " 'cano': 1885,\n",
       " 'sacrific': 11122,\n",
       " 'daown': 3158,\n",
       " 'snake': 11904,\n",
       " 'bite': 1354,\n",
       " 'sharp': 11583,\n",
       " 'gallopin': 5356,\n",
       " 'ailment': 280,\n",
       " 'somethin': 11985,\n",
       " 'afor': 225,\n",
       " 'cud': 3033,\n",
       " 'simpli': 11746,\n",
       " 'forrad': 5130,\n",
       " 'wa': 14372,\n",
       " 'bit': 1353,\n",
       " 'horribl': 6207,\n",
       " 'arter': 735,\n",
       " 'lip': 7552,\n",
       " 'marbl': 7904,\n",
       " 'pallor': 9273,\n",
       " 'absolut': 46,\n",
       " 'needless': 8628,\n",
       " 'ahead': 270,\n",
       " 'spars': 12067,\n",
       " 'grass': 5651,\n",
       " 'scrub': 11371,\n",
       " 'blueberri': 1427,\n",
       " 'bush': 1762,\n",
       " 'rock': 10975,\n",
       " 'crag': 2920,\n",
       " 'peak': 9440,\n",
       " 'grey': 5699,\n",
       " 'limit': 7533,\n",
       " 'seren': 11515,\n",
       " 'unabl': 13504,\n",
       " 'rest': 10798,\n",
       " 'resolv': 10785,\n",
       " 'poor': 9886,\n",
       " 'william': 14631,\n",
       " 'murder': 8493,\n",
       " 'observ': 8903,\n",
       " 'rem': 10688,\n",
       " 'threw': 13026,\n",
       " 'shade': 11554,\n",
       " 'cornelius': 2822,\n",
       " 'agrippa': 267,\n",
       " 'albertus': 311,\n",
       " 'magnus': 7801,\n",
       " 'paracelsus': 9306,\n",
       " 'lord': 7662,\n",
       " 'fatal': 4743,\n",
       " 'overthrow': 9203,\n",
       " 'disinclin': 3635,\n",
       " 'pursu': 10310,\n",
       " 'accustom': 93,\n",
       " 'studi': 12427,\n",
       " 'ex': 4529,\n",
       " 'queen': 10357,\n",
       " 'idri': 6371,\n",
       " 'adrian': 170,\n",
       " 'total': 13194,\n",
       " 'unfit': 13705,\n",
       " 'earldom': 4014,\n",
       " 'becom': 1150,\n",
       " 'pupil': 10286,\n",
       " 'access': 69,\n",
       " 'diminut': 3539,\n",
       " 'underw': 13644,\n",
       " 'contract': 2754,\n",
       " 'dilat': 3529,\n",
       " 'felin': 4798,\n",
       " 'tribe': 13319,\n",
       " 'largest': 7330,\n",
       " 'branch': 1561,\n",
       " 'legrand': 7438,\n",
       " 'quiver': 10388,\n",
       " 'awhil': 945,\n",
       " 'draperi': 3851,\n",
       " 'length': 7447,\n",
       " 'surfac': 12608,\n",
       " 'brass': 1567,\n",
       " 'matern': 7975,\n",
       " 'selfish': 11459,\n",
       " 'begin': 1185,\n",
       " 'calam': 1825,\n",
       " 'thoughtless': 13011,\n",
       " 'enthusiasm': 4350,\n",
       " 'sick': 11689,\n",
       " 'helpless': 6028,\n",
       " 'protect': 10198,\n",
       " 'girl': 5501,\n",
       " 'commit': 2527,\n",
       " 'inter': 6821,\n",
       " 'friend': 5227,\n",
       " 'conduct': 2631,\n",
       " 'geneva': 5432,\n",
       " 'extravag': 4636,\n",
       " 'proposit': 10181,\n",
       " 'remain': 10689,\n",
       " 'silent': 11721,\n",
       " 'collect': 2465,\n",
       " 'thought': 13010,\n",
       " 'better': 1292,\n",
       " 'combat': 2496,\n",
       " 'scheme': 11306,\n",
       " 'particular': 9363,\n",
       " 'mr': 8457,\n",
       " 'theodor': 12954,\n",
       " 'siniv': 11765,\n",
       " 'someth': 11984,\n",
       " 'definit': 3290,\n",
       " 'disadvantag': 3568,\n",
       " 'danger': 3152,\n",
       " 'everyon': 4515,\n",
       " 'inclin': 6542,\n",
       " 'hold': 6152,\n",
       " 'public': 10247,\n",
       " 'togeth': 13137,\n",
       " 'live': 7582,\n",
       " 'dear': 3206,\n",
       " 'fellow': 4803,\n",
       " ...}"
      ]
     },
     "execution_count": 91,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "cv.transform()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
